<template>
    <div class="chart" id="threechart" style="width: 600px;height: 350px;margin: 30px auto;"></div>
</template>

  
<script>
import * as echarts from "echarts";
export default {
  mounted() {
      // 获取容器元素
      const chartContainer = document.getElementById("threechart");
      // 初始化 ECharts 实例
      const myChart = echarts.init(chartContainer);
       // 设置图表的配置项和数据
      const option = {
        xAxis: {
                type: 'category',
                data: ['借阅三室', '自习二室', '自习一室', '阅览室', '借阅一室']
            },
            yAxis: {
                type: 'value'
            },
            series: [{
                data: [1200,900,670,530,490],
                type: 'bar'
            }]
      
};
// 将配置项应用到图表实例上
myChart.setOption(option);
},
  };

</script>
  
<style lang='less'>

</style>
